<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAkbusMileageTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('akbus_mileage', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->date('date')->nullable()->comment('时间');
            $table->string('team')->nullable()->comment('车队');
            $table->tinyInteger('line')->nullable()->comment('线路');
            $table->string('license_plate_num')->nullable()->comment('车牌号');
            $table->string('self_numbering')->nullable()->comment('自编号');
            $table->decimal('plan_times', 5, 1)->nullable()->comment('计划趟次');
            $table->decimal('actual_times', 5, 1)->nullable()->comment('实际趟次');
            $table->decimal('drop_off', 5, 1)->nullable()->comment('掉趟');
            $table->decimal('departure_rate', 6, 4)->nullable()->comment('出车率');
            $table->decimal('operating_mileage', 10, 2)->nullable()->comment('运营里程');
            $table->decimal('non-operating_mileage', 10, 2)->nullable()->comment('非运营里程');
            $table->decimal('gps_mileage', 10, 2)->nullable()->comment('GPS总里程');
            $table->decimal('plan_mileage', 10, 2)->nullable()->comment('计划里程');
            $table->decimal('rated_mileage', 10, 2)->nullable()->comment('额定里程');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('akbus_mileage');
    }
}
